'use strict';
var srcAssets='./';
var developmentAssets = './dist';
var config = {
    autoprefixer: {
        browsers: [
            'last 2 versions',
            'safari 5',
            'ie 8',
            'ie 9',
            'opera 12.1',
            'ios 6',
            'android 4'
        ],
        cascade: true
    }

};
var gulp = require('gulp');

// 引入组件
var plumber      = require('gulp-plumber');
var browsersync  = require('browser-sync');
var sass         = require('gulp-sass');
var gulpFilter   = require('gulp-filter');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps   = require('gulp-sourcemaps');
var cssmin       = require('gulp-minify-css');


gulp.task('sass', function() {
    return gulp.src(srcAssets + '/scss/utils/*.scss')
        .pipe(sourcemaps.init())
        .pipe(sass({sourcemap: true, sourcemapPath: 'style.css'}).on('error', sass.logError))
        .pipe(autoprefixer(config.autoprefixer))
        .pipe(sourcemaps.write('./maps'))
        .pipe(gulp.dest(developmentAssets + '/styles/utils/'));
});

gulp.task('default', function(){
    gulp.run('sass');
    gulp.watch(srcAssets + '/scss/**/*.scss', function(){
        gulp.run('sass');
    });
});